// hyb_yl/mysubpages/pages/capitadetail/capitadetail.js
var app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    tabitem: ['订单流水', '提现流水'],
    docindex: 0,
    capitalist: [{}, {}, {}],
    did: "",
    keyword: "",
    page: 0,
    pagesize: 10,
    list: []
  },
  doctab: function (e) {
    const index = e.currentTarget.dataset.dex;
    this.setData({
      docindex: index
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var did = options.did;
    var keyword = options.keyword;
    var that = this;
    that.setData({
      did: did,
      keyword: keyword
    })
    that.getList();
  },
  getList: function () {
    var that = this;
    app.util.request({
      'url': "entry/wxapp/green.pay_list",
      data: {
        did: that.data.did,
        openid: wx.getStorageSync('openid'),
        page: that.data.page,
        pagesize: that.data.pagesize,
        keyword: that.data.keyword
      },
      success: function (res) {

        var page = that.data.page + 1;

        that.setData({
          page: page,
          list: that.data.list.concat(res.data)
        })
      }
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    this.getList();
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})